package com.example.springboot.service;

import com.example.springboot.entity.Abandon;
import com.example.springboot.mapper.AbandonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AbandonService {
    @Autowired
    private AbandonMapper abandonMapper;

    public int save(Abandon abandon){
        if(abandon.getId()==null){
            if(abandon.getIsApprove()==null){
                abandon.setIsApprove("未审批");
            }
            return abandonMapper.insert(abandon);
        }else{
            return abandonMapper.update(abandon);
        }
    }
}
